package com.demo.ms.service.impl;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.demo.ms.dao.UserDao;
import com.demo.ms.pojo.User;
import com.demo.ms.service.UserService;

@Service("userService")
public class UserServiceImpl implements UserService {
    
	@Resource
	private UserDao userDao;
	
	public UserDao getUserDao() {
		return userDao;
	}
	
	public void setUserDao(UserDao userDao) {
		this.userDao = userDao;
	}

	@Override
	public void save(User user) {
		
	}

	@Override
	public void update(User user) {

	}

	@Override
	public void delete(int id) {

	}

	@Override
	public User findById(int id) {
		return userDao.findById(id);
	}

	@Override
	public List<User> findAll() {
		return null;
	}

	@Override
	public User login(String name, String password) {
		Map<String, String> map=new HashMap<String, String>();
		map.put("name", name);
		map.put("password", password);
		return this.userDao.findUser(map);
		
	}




}
